﻿namespace Sidvall.UI.Entities
{
    public sealed class GenericDataItem : BusinessBase
    {
        #region Public Members

        #region BooleanValue1

        private bool? _BooleanValue1;
        public bool? BooleanValue1
        {
            get
            {
                return _BooleanValue1;
            }
            set
            {
                if (_BooleanValue1 == value)
                    return;
                _BooleanValue1 = value;
                OnPropertyChanged(nameof(BooleanValue1), true, true);
            }
        }

        #endregion
        #region BooleanValue2

        private bool? _BooleanValue2;
        public bool? BooleanValue2
        {
            get
            {
                return _BooleanValue2;
            }
            set
            {
                if (_BooleanValue2 == value)
                    return;
                _BooleanValue2 = value;
                OnPropertyChanged(nameof(BooleanValue2), true, true);
            }
        }

        #endregion
        #region DateTimeValue1

        private System.DateTime? _DateTimeValue1;
        public System.DateTime? DateTimeValue1
        {
            get
            {
                return _DateTimeValue1;
            }
            set
            {
                if (_DateTimeValue1 == value)
                    return;
                _DateTimeValue1 = value;
                OnPropertyChanged(nameof(DateTimeValue1), true, true);
            }
        }

        #endregion
        #region DateTimeValue2

        private System.DateTime? _DateTimeValue2;
        public System.DateTime? DateTimeValue2
        {
            get
            {
                return _DateTimeValue2;
            }
            set
            {
                if (_DateTimeValue2 == value)
                    return;
                _DateTimeValue2 = value;
                OnPropertyChanged(nameof(DateTimeValue2), true, true);
            }
        }

        #endregion
        #region IntegerValue1

        private long? _IntegerValue1;
        public long? IntegerValue1
        {
            get
            {
                return _IntegerValue1;
            }
            set
            {
                if (_IntegerValue1 == value)
                    return;
                _IntegerValue1 = value;
                OnPropertyChanged(nameof(IntegerValue1), true, true);
            }
        }

        #endregion
        #region IntegerValue2

        private long? _IntegerValue2;
        public long? IntegerValue2
        {
            get
            {
                return _IntegerValue2;
            }
            set
            {
                if (_IntegerValue2 == value)
                    return;
                _IntegerValue2 = value;
                OnPropertyChanged(nameof(IntegerValue2), true, true);
            }
        }

        #endregion
        #region TextValue1

        private string _TextValue1 = string.Empty;
        public string TextValue1
        {
            get
            {
                return _TextValue1;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_TextValue1 == value)
                    return;
                _TextValue1 = value;
                OnPropertyChanged(nameof(TextValue1), true, true);
            }
        }

        #endregion
        #region TextValue2

        private string _TextValue2 = string.Empty;
        public string TextValue2
        {
            get
            {
                return _TextValue2;
            }
            set
            {
                value = Sidvall.Business.ValidationManager.GetValidString(value, false, null);
                if (_TextValue2 == value)
                    return;
                _TextValue2 = value;
                OnPropertyChanged(nameof(TextValue2), true, true);
            }
        }

        #endregion

        #endregion
        #region Constructors

        public GenericDataItem()
        {
        }

        #endregion
    }
}
